#include "class.h"
#include <iostream>

using namespace std;

Animal::Animal(string theName,int wt):name(theName),weight(wt){}
void Animal::PublicWho() const
{   cout<<"i am public funcion in base class\n";
    cout<<"\n myname is"<<name<< " and  i am "<<weight<< " weight"<<endl;
    cout<<"===================\n";
}
void Animal::ProtectedWho() const
{
    cout<<"\n i am protect function in base class \n";
    cout<<"\n myname is"<<name<< " and  i am "<<weight<< " weight"<<endl;
      cout<<"===================\n";
}
void Lion:: LionWho() const
{   cout<<"i am public funcion in derived class but i use the base class 's protected function\n";
    cout<<"i am lion\n";
    Animal::ProtectedWho();
    cout<<"===================\n";
}
void Adark:: AdarkWho() const
{   cout<<"i am public funcion in derived class but i use the base class 's protected function\n";
    cout<<"i am Adark";
    Animal::ProtectedWho();//by the derived class 's memeber function  using the father class's protected function
    cout<<"===================\n";
}


Person::Person(int theAge,string theName,char theGender):
    age(theAge),name(theName),gender(theGender){
}

void Person::who()const{
    cout<<"\n Thist is"<<name<<"who is"<<age<<"years old";
}
void Employee::who() const{
    cout<<endl
        <<name<<"is a "<<(gender=='f'?"female":"male")
        <<" employee aged "<<age<<".";
}
  
void Executive::who() const{
    cout<<endl
        <<name<<" is a "<<(gender=='f'? "female":"male")
        <<"execute.";
}
